<?php
$this->headLink()
    ->appendStylesheet('extjs/resources/css/ext-all.css');

$this->headScript()
    //->appendFile('extjs/adapter/ext/ext-base.js')
    //->appendFile('extjs/ext-all.js')
    ->appendFile('extjs/ext.js')
    ->appendFile('js/articles-grid.js')
    //->appendFile('js/flashmessage.js')
    ;
?>

<? $this->headTitle('Articles'); ?>
<? $this->placeholder('title')->set('Articles'); ?>

<p>
    <a href="<?php echo $this->url(array('controller'=>'articles', 'action'=>'add')); ?>">Add New Article</a>
</p>
<dl class="zend_form">
<?
    $this->authorSelect->setLabel('Author');
    echo $this->authorSelect;
    echo $this->categorySelect;
?>
</dl>

<div id="article-grid"></div>

<script type="text/javascript">
<?php $this->headScript()->captureStart() ?>
jQuery(document).ready(function(){
    jQuery('#user_id').change(function(){
        reloadGrid(jQuery(this).val(), jQuery('#category_id').val());
    });

    jQuery('#category_id').change(function(){
        reloadGrid(jQuery('#user_id').val(), jQuery(this).val());
    });

    reloadGrid(0, 0);
});
<?php $this->headScript()->captureEnd(); ?>
</script>